package com.jz.community.moduleshoppingguide.home.ui.activity;

import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;
import android.widget.ImageView;
import android.widget.TextView;

import com.flyco.tablayout.SlidingTabLayout;
import com.jz.community.basecomm.base.BaseMvpActivity;
import com.jz.community.basecomm.mvp.BaseMvpPresenter;
import com.jz.community.moduleshoppingguide.R;
import com.jz.community.moduleshoppingguide.R2;
import com.jz.community.moduleshoppingguide.home.ui.adapter.PreferentialAdapter;

import butterknife.BindView;

public class PreferentialActivity extends BaseMvpActivity {


    @BindView(R2.id.title_back_left)
    ImageView titleBackLeft;
    @BindView(R2.id.title_name)
    TextView titleName;
    @BindView(R2.id.st_sliding_category)
    SlidingTabLayout stSlidingCategory;
    @BindView(R2.id.viewpager_goods)
    ViewPager viewpagerGoods;
    @BindView(R2.id.title_toolbar)
    Toolbar titleToolbar;
    PreferentialAdapter adapter;


    @Override
    protected int getContentView() {
        return R.layout.module_shoppingguide_activity_preferential;
    }

    @Override
    protected BaseMvpPresenter createPresenter() {
        return null;
    }

    @Override
    protected void initDatas() {
        titleName.setText("优惠专区");
        setImmersionBar(titleToolbar);
        adapter = new PreferentialAdapter(getSupportFragmentManager());
        viewpagerGoods.setAdapter(adapter);
        stSlidingCategory.setViewPager(viewpagerGoods);
    }

    @Override
    protected void addListener() {
        titleBackLeft.setOnClickListener(v -> finish());
    }


}
